﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Dimok.Shared {
  public partial class ReportProfile{
    public IEnumerable<string> GetDefaultColumns<TEntity>() { return GetDefaultColumns(typeof(TEntity).Name); }
    public IEnumerable<string> GetDefaultColumns(Type entityType) { return GetDefaultColumns(entityType.Name); }
    public IEnumerable<string> GetDefaultColumns(string entityType) {
      if (MetaTables.ContainsKey(entityType))
        return MetaTables[entityType].Where(mf => mf.Value.DisplayIndex > 0)
          .Select(mf => new { Column = mf.Key, Index = mf.Value.DisplayIndex }).OrderBy(c => c.Index).Select(c => c.Column);
      return null;
    }
  }
}
